<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <img src="u=1471277967,813100225&fm=26&gp=0.jpg" class="ad" id="ad">
    <script>
        var img=document.getElementById("ad")
    var i=0;
    var a=setInterval(function(){
        if(i<=10){
          console.log(i++);   
        }else{
          img.src=" ";
            clearInterval(a);  
        }
       
    },1000)

    
    
    </script>
    
</body>
</html>